-
Notifications
You must be signed in to change notification settings - Fork 26
Update benchmarks #103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update benchmarks #103
Conversation
benchmark/Benchmark/Free326759a.purs
Outdated
@@ -0,0 +1,245 @@ | |||
module Benchmark.Free326759a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a direct copy/paste of the v5.2.0 Control.Monad.Free
module.
-- | A _trampoline_ monad, which can be used at the bottom of | ||
-- | a monad transformer stack to avoid stack overflows in large | ||
-- | monadic computations. | ||
module Benchmark.Trampoline326759a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a copy/paste of the v5.2.0 Control.Monad.Trampoline
module.
benchmark/Benchmark/Main.purs
Outdated
import Benchmark.Trampoline0df59c5 as Trampoline0df59c5 | ||
import Benchmark.Trampoline326759a as Trampoline326759a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found it easier to tell what code came from what module by qualifying both of them with their commit, instead of only qualifying the old v0.6.1 code.
These are the charts generated with https://harry.garrood.me/purescript-benchotron-svg-renderer for the four benchmarks. The left-bind benchmark with large inputs doesn't contain the v0.6.1 code because it has a stack overflow. |
Unfortunately I can't review this as I'm busy for this month. Thanks for working on this tho! |
Unless a maintainer objects, I'll go ahead and merge this within the next few days given that it doesn't affect the library internals and re-enables a very useful set of benchmarks. The disabled test can be re-enabled in the future if necessary. |
Sounds good to me |
This PR updates the benchmarks so they can be run on the current (v5.2.0) and previous (v0.6.1) implementations. The old (v0.6.1) implementation suffers from a stack overflow in the left-bind benchmark, so for the time being I've simply disabled it. Open to suggestions if anyone knows how to fix that!
This PR supersedes #88. It also includes commands in the
package.json
file to build and run the benchmarks. Finally, it compiles (but does not run) the benchmarks as part of CI, just so they don't get so horribly out of date again in the future.As part of this change, I've moved the current v5.2.0 implementation of
Free
/Trampoline
into the benchmarks directory. That way we can use it as a reference when testing any future performance changes, as we're not exactly going to return to the v0.6.1 design -- v5.2.0 is a better reference for future benchmarks.This PR is a first step towards testing a new implementation for
Free
which is significantly faster in the Halogen Hooks benchmarks:thomashoneyman/purescript-halogen-hooks#61
Also closes #47.